package cn.tedu.myboot1.controller;

import cn.tedu.myboot1.entity.MyUser;
import cn.tedu.myboot1.mapper.UserMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class UserController {
    @Autowired(required = false)
    UserMapper mapper;
    @RequestMapping("/check")
    public String check(String username){
        MyUser user =mapper.check(username);
        if (user!=null){
            return "用户已存在！";
        }
        return "用户名可用！";
    }
}
